package net.sourceforge.peertwitter.mbpast.messaging;

import java.util.concurrent.atomic.AtomicInteger;

import rice.p2p.commonapi.Id;
import rice.p2p.commonapi.NodeHandle;

public class ReplicaTimestampRequest extends MBPastMessageTemplate {

	private static final long serialVersionUID = -4525804819201266733L;
	private final Id id;
	private static transient AtomicInteger ai = new AtomicInteger(0);
	
	@Override
	public String toString() {
		return "ReplicaTimestampRequest [sender=" + getSender() + ", id=" + id
				+ ", uniqueId=" + uniqueId + "]";
	}

	private final int uniqueId;

	public Id getReplicaId() {
		return id;
	}


	public ReplicaTimestampRequest(NodeHandle sender, Id replicaId) {
		super(sender);
		this.id = replicaId;
		this.uniqueId = ai.getAndIncrement();
	}
	
	public int getUniqueId() {
		return uniqueId;
	}

	@Override
	public int getPriority() {
		return HIGH_PRIORITY;
	}

}
